package cn.hotel.service.impl;

import cn.hotel.entity.Cleaner;
import cn.hotel.mapper.CleanerMapper;
import cn.hotel.service.CleanerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CleanerServiceImpl implements CleanerService {

    @Resource
    private CleanerMapper cleanerMapper;

    @Override
    public List<Cleaner> getAllCleaner() {
        List<Cleaner> allCleaner = cleanerMapper.getAllCleaner();
        return allCleaner;
    }

    @Override
    public int delById(Integer cleanerId) {
        int i = cleanerMapper.delById(cleanerId);
        return i;
    }

    @Override
    public int addCleaner(Cleaner cleaner) {
        int i = cleanerMapper.addCleaner(cleaner);
        return i;
    }

    @Override
    public int updateCleaner(Cleaner cleaner) {
        int i = cleanerMapper.updateCleaner(cleaner);
        return i;
    }

    @Override
    public Cleaner getById(Integer cleanerId) {
        Cleaner byId = cleanerMapper.getById(cleanerId);
        return byId;
    }

    @Override
    public int getCount() {
        int count = cleanerMapper.getCount();
        return count;
    }

    @Override
    public int updateNum(Integer cleanerId , String status) {
        int i = cleanerMapper.updateNum(cleanerId,status);
        return i;
    }
}
